home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / 24 aspnet applications / aspnetapplications / traceform.aspx.vb < prev    next >
Encoding:
Text File  |  2002-03-18  |  1.4 KB  |  44 lines

  1.  
  2. Public Class TraceForm
  3.     Inherits System.Web.UI.Page
  4.     Protected WithEvents txtValue As System.Web.UI.WebControls.TextBox
  5.     Protected WithEvents btnRefresh As System.Web.UI.WebControls.Button
  6.     Protected WithEvents lblTime As System.Web.UI.WebControls.Label
  7.  
  8. #Region " Web Form Designer Generated Code "
  9.  
  10.     'This call is required by the Web Form Designer.
  11.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  12.  
  13.     End Sub
  14.  
  15.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  16.         'CODEGEN: This method call is required by the Web Form Designer
  17.         'Do not modify it using the code editor.
  18.         InitializeComponent()
  19.     End Sub
  20.  
  21. #End Region
  22.  
  23.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  24.         Trace.TraceMode = TraceMode.SortByTime
  25.         DoSomething("ABC")
  26.     End Sub
  27.  
  28.     ' a sample routine that outputs to the Trace page
  29.  
  30.     Sub DoSomething(ByVal arg As String)
  31.         Trace.Write("FLOW", "Entering Sub DoSomething")
  32.         Trace.Write("arg = " & arg)
  33.  
  34.         Try
  35.             Throw New ArgumentException()
  36.         Catch ex As Exception
  37.             Trace.Warn("ERRORS", "An exception has occurred", ex)
  38.         Finally
  39.             Trace.Write("FLOW", "Exiting Sub DoSomething")
  40.         End Try
  41.     End Sub
  42.  
  43. End Class
  44.